import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        night: true,
        readStyle: {
            fontSize: '18px',
            color: '#000500',
            background: '#ffffff',
            lineHeight: 1.5
        },
        currentCategory: '玄幻小说'
    },
    mutations: {
        updateNight(state, n) {
            state.night = n
        },
        updateStyle(state, n) {
            state.readStyle.fontSize = n.fontSize + 'px'
            state.readStyle.lineHeight = n.lineHeight.toFixed(1)
            state.readStyle.color = n.color
            state.readStyle.background = n.background
        },
        updateCategory(state, n) {
            state.currentCategory = n
        }
    },
    actions: {

    }
})